<?php
class Default_TemplateController extends Zend_Controller_Action {
	public function init() {
		/* Initialize action controller here */
		$this->newModel = new Default_Model_DbTable_News ();
		$this->_model = new Default_Model_DbTable_Photo();
	}
	public function indexAction() {
		$maxId = $this->newModel->getNewsMaxId ( 23 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$this->view->topViewRe = $this->newModel->topRecrui ( 23 );
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 23, $maxId ['m'] );
		$this->view->intro = $intro;
	}
	public function goidemoAction() {
		$maxId = $this->newModel->getNewsMaxId ( 24 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$this->view->topViewRe = $this->newModel->topRecrui ( 24 );
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 24, $maxId ['m'] );
		$this->view->intro = $intro;
	}
	public function goicodingAction() {
		$maxId = $this->newModel->getNewsMaxId ( 25 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$this->view->topViewRe = $this->newModel->topRecrui ( 25 );
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 25, $maxId ['m'] );
		$this->view->intro = $intro;
	}
	public function goigiareAction() {
		$maxId = $this->newModel->getNewsMaxId ( 26 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$this->view->topViewRe = $this->newModel->topRecrui ( 26 );
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 26, $maxId ['m'] );
		$this->view->intro = $intro;
	}
		public function goimienphiAction() {
		$maxId = $this->newModel->getNewsMaxId ( 36 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$this->view->topViewRe = $this->newModel->topRecrui ( 36 );
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 36, $maxId ['m'] );
		$this->view->intro = $intro;
	}
	public function giaodienwebsiteAction() {
		$id = $this->getRequest()->getParam("id");
		$new = $this->newModel->getNewsById($id);
		$this->view->news = $new;
		$this->view->allDesign = $this->_model->fetchAll ( "PHOTO_LIB_ID = $id" )->toArray ();
	}
}

